<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function rest1() {
      console.log("没有扩展运算符----", arguments)
    }
    //__proto__: Object
    function rest2(...args) {
      console.log("扩展运算符的应用----", args)
    }
    //__proto__: Array(0)
    const f4 = ['a', 'b', 'c', 'd']
    rest1(f4)
    rest2(...f4)
    //运用数组api
    //数组的合并
    const m = ['g', 'h', 'j', 'k']
    const f = ['gg', 'hh', 'jj', 'kk']
    const hebing = [...m, ...f]
    console.log(hebing)
    // 扩展运算符的认识.html:26 Array(8)0: "g"1: "h"2: "j"3: "k"4: "gg"5: "hh"6: "jj"7: "kk"length: 8__proto__: Array(0)
    //数组的克隆
  </script>
</head>

<body>

</body>
<div>1111</div>
<div>2222</div>
<div>3333</div>
<script>
  //将类数组转为真数组
  const divs = document.querySelectorAll('div')
  const divsArr1 = [...divs]
  console.log(divsArr1)
  const divsArr2 = Array.from(divs)
  console.log(divsArr2)
</script>

</html>